import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

export function generateDiagram(data) {
  return request({
    url: '/zhishiku/chat/generate-diagram',
    method: 'post',
    data: data
  })
}

// 创建会话
export function createSession(data) {
    return request({
      url: '/zhishiku/chat/create/session',
      method: 'post',
      data: data
    })
  }


  // 查询会话列表
export function getSessions(data) {
  return request({
    url: '/zhishiku/chat/getsessions',
    method: 'post',
    data: data
  })
}


//获取会话内容
export function getChatList(data) {
  return request({
    url: '/zhishiku/chat/getsession',
    method: 'post',
    data: data
  })
}


//删除会话
export function delSession(data) {
  return request({
    url: '/zhishiku/chat/deleteSessions',
    method: 'post',
    data: data
  })
}


//发送聊天内容
export function Chat(data) {
  return request({
    url: '/zhishiku/chat/completion',
    method: 'post',
    data: data
  })
}

//更新会话
export function updataSession(data,sessionId) {
  return request({
    url: '/zhishiku/chat/session/'+sessionId,
    method: 'put',
    data: data
  })
}